<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="/resource/common.jsp"%> 
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <%--统一用户管理平台新增角色 --%>
    <title>${title}</title>
	<!-- 
	 -->
	<script type="text/javascript">	
		/**显示提示并关闭窗口*/
		function tipclose(data){
			if(data){
				art.dialog.tips(data.msg.body);
				if("1" == data.msg.status){
					
					window.setTimeout(function() {
						top.refresh('reloadList');
						art.dialog.close();
					}, 1500);
					
				}
			}
		}
		
		
		$(function(){
			$("body").css({visibility:"visible"});
		});
		
		
		function saveSysRole(){
			
			if($("#query_form").form('validate'))
			{
				
				top.mask();
				
				$("#query_form").ajaxSubmit({
					url:parent.formateUrl("sys/role/create.json"),
					type:"post",
					dataType:"json",
					success:function(data){
					    //top.unmask();
						if("1" == data.msg.status){
							if("0"==data.result){
								//tipclose(data);
								top.showMsg(data.msg.body);
								top.refresh('afterSave');
							}else{
								top.showMsg(data.msg.body);
								window.setTimeout(function() {
									top.unmask();
								}, 1500);
							}
						}
					},
					error:function(){
						top.unmask();
						//art.dialog.tips("角色新增失败！",1.5);
					}
				});
			}
		}
	</script>
</head>
<body style="margin:0px;padding:0px;" >
	<div>
		<form id="query_form" action="sys/role/create.json" method="post" style="padding:0px;margin:0px;width：350px;">
			<table style="padding:0px;margin:0px;width：350px;">
	   			<tr style="height:30px;">
	   				<td class="td_label">角色名称:</td>
	   				<td>
	   					<input id="rname" class="easyui-validatebox" data-options='required:true,tipPosition:"bottom",missingMessage:"请输入角色名称"'  style="width:200px;" type="text" name="rname" value="${data.rname}" maxlength="25" onblur="this.value=this.value.replace(/\s/g,'');"/>
	   					<input type="hidden" name="rcode" value="${data.rcode}"/>
	   				</td>
	   			</tr>
	   			<tr style="height:30px;">
	   				<td class="td_label">备注信息:</td>
	   				<td><input id="remark" type="text"  style="width:200px;" name="remark" value="${data.remark}" maxlength="25" onblur="this.value=this.value.replace(/\s/g,'');"/></td>
	   			</tr>
	   			<tr style="height:30px;">
	   				<td class="td_label" >系统排序:</td>
	   				<td><input id="ordernum" type="text" class="easyui-numberbox" data-options='required:true,tipPosition:"bottom",missingMessage:"请输入数字"'  style="width:200px;"  name="ordernum" value="${0 == data.ordernum ? '':data.ordernum}" onblur="this.value=this.value.replace(/[^0-9]/g,'');" maxlength="5"/></td>
	   			</tr>
	   		</table>
		</form>
	</div>
</body>
</html>
